package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable9;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable9.UserBaseTable9DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable9.vo.*;

/**
 * 商业商住楼写字楼二次抵押 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable9Mapper extends BaseMapperX<UserBaseTable9DO> {

    default PageResult<UserBaseTable9DO> selectPage(UserBaseTable9PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable9DO>()
                .eqIfPresent(UserBaseTable9DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable9DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable9DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable9DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable9DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable9DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable9DO::getLocation, reqVO.getLocation())
                .eqIfPresent(UserBaseTable9DO::getLocationFloor, reqVO.getLocationFloor())
                .eqIfPresent(UserBaseTable9DO::getRent, reqVO.getRent())
                .eqIfPresent(UserBaseTable9DO::getOddCorpus, reqVO.getOddCorpus())
                .betweenIfPresent(UserBaseTable9DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable9DO::getId));
    }

    default List<UserBaseTable9DO> selectList(UserBaseTable9ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable9DO>()
                .eqIfPresent(UserBaseTable9DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable9DO::getArea, reqVO.getArea())
                .eqIfPresent(UserBaseTable9DO::getLandTypes, reqVO.getLandTypes())
                .eqIfPresent(UserBaseTable9DO::getBuildingStructure, reqVO.getBuildingStructure())
                .eqIfPresent(UserBaseTable9DO::getHouseType, reqVO.getHouseType())
                .eqIfPresent(UserBaseTable9DO::getAreaOfStructure, reqVO.getAreaOfStructure())
                .eqIfPresent(UserBaseTable9DO::getLocation, reqVO.getLocation())
                .eqIfPresent(UserBaseTable9DO::getLocationFloor, reqVO.getLocationFloor())
                .eqIfPresent(UserBaseTable9DO::getRent, reqVO.getRent())
                .eqIfPresent(UserBaseTable9DO::getOddCorpus, reqVO.getOddCorpus())
                .betweenIfPresent(UserBaseTable9DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable9DO::getId));
    }

}
